package com.qf.smsplatform.gateway.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: LeeRui
 * 2021/2/3 下午 10:50
 **/
@FeignClient(value = "sms-platform-cache")
public interface CacheService {

    //保存数据到redis的zset结构中，zadd key score  member
    @RequestMapping(value = "/cache/zadd", method = RequestMethod.POST)
    public boolean zadd(@RequestParam("key") String key, @RequestParam("value") Long value, @RequestParam("member") Long member);

    //通过key获取String类型信息
    @RequestMapping(value = "/cache/get/{key}", method = RequestMethod.GET)
    public String get(@PathVariable("key") String key);

    //通过key和指定field将对应的value进行增加
    @RequestMapping(value = "/cache/hincr/{key}/{field}/{delta}", method = RequestMethod.POST)
    public Long hincr(@PathVariable("key") String key,@PathVariable("field") String field, @PathVariable("delta") long delta);
}
